<template>
  <div>
    <module-title :title="moduleTitle"></module-title>
    <el-card>
      <el-form :inline="true" class="demo-form-inline">
        <el-col :span="24"
          ><div class="grid-content bg-purple button1">
            <el-button type="primary" plain class="title" @click="backOff" round
              >返回</el-button
            >
          </div></el-col
        >
      </el-form>
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        :header-cell-style="{
          background: '#d9d9d9',
          color: 'rgb(16, 116, 253)',
        }"
      >
        <el-table-column prop="orderName" label="工作室名称"> </el-table-column>
        <el-table-column prop="price" label="粉单价"> </el-table-column>
        <el-table-column prop="orderType" label="工单类型"> </el-table-column>
        <el-table-column prop="finished" label="有效粉丝数"> </el-table-column>
        <el-table-column prop="triggerNum" label="总触发链接数">
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import ModuleTitle from "@/components/content/ModuleTitle.vue";
import API from "@/network/api/smsApi";

export default {
  name: "studioData",
  data() {
    return {
      moduleTitle: "工作室数据",
      tableData: [],
      rowData: null,
      orderParam: {
        account: '',
        workId: '',
        pageSize: 10,
        pageNum: 1,
        startTime: '',
        endTime: ''
      },
    };
  },
  components: {
    ModuleTitle,
  },
  created() {
    this.rowData = this.$store.state.dataRow
    this.orderParam.workId = this.rowData.workId
    console.log(this.rowData);
  },
  mounted() {
    API.getWorkAccountInfo(this.orderParam).then((res) => {
      console.log(res);
      if (res.data.code === 0) {
        this.tableData = res.data.data.records;
        console.log(this.tableData);
        for(let i = 0; i < this.tableData.length; i++) {
          this.tableData[i].orderName = this.rowData.orderName
          this.tableData[i].price = this.rowData.price
          this.tableData[i].orderType = this.rowData.orderType
        }
      }
    });
  },
  methods: {
    backOff() {
      this.$router.back();
    },
  },
};
</script>

<style>
.demo-form-inline {
  margin-bottom: 45px;
}

.button1 {
  text-align: right;
}

.title {
  width: 100px;
  margin-top: -7px;
}
</style>